package Test;

import java.util.Scanner;

/*
【字符串中找出连续最长的数字串】读入一个字符串str，输出字符串str中的连续最长的数字串
示例1：
输入abc12345ed125ss123456789
输出123456789
* */
public class Test5 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        String cur = "";
        String ret = "";//用来存放最后结果
        int i = 0;
        for ( i = 0; i < str.length(); i++) {
            char ch = str.charAt(i);
            //判断属于数字就放到cur中
            if(ch >= '0' && ch <= '9'){
                cur = cur + ch+"";
            }else{
                //遇到字母，就判断字符串数组cur与ret的长度，
                if(cur.length() > ret.length()){
                    ret = cur;
                }else{
                    cur = "";
                }
            }
        }
        if(i == str.length() && cur.length() > ret.length()){
            ret = cur;
        }
        System.out.println(ret);
    }
}
